<?php 
class subscribe_models_admin extends CI_Model{
	public function __construct(){
		$this->load->database();
	}
   public function add($mail){
   		$query = $this->db->get_where('subscribe', array('sEmail' => $mail),1);
   		if(!$query->num_rows()){
   			$this->db->insert('subscribe', array('sEmail' => $mail));
   		}
   }
   public function totalEmail() {
   	 return $this->db->count_all('subscribe');
   }
   
   public function get_emails($isPage,$perPage) {
   	 $query = $this->db->get('subscribe',$perPage,$isPage);
   	 foreach ( $query->result() as $row)
   	 	$result[$row->id]=$row->sEmail;
   	 if(isset($result)) return $result;
   	 
   	 return false;
   }
}